@echo off

set VCVARSBAT=C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat
if exist "%VCVARSBAT%" goto found
set VCVARSBAT=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat
if not exist "%VCVARSBAT%" echo ERROR: vcvarsall.bat not found & goto END

:found
call "%VCVARSBAT%"

rem call vcvarsall.bat rem does it need the arch?
rem call vcvarsall.bat x86
rem call vcvarsall.bat x86_amd64

rmdir /s build
mkdir build
cd build
cmake ..\src -G "NMake Makefiles"
nmake

:END
echo.
pause
